

const path = require('path');
const staticImg = path.join(__dirname, 'static');

function SensorbitUnoBlocks(Blockly) {
    var color_do = "#FF0000";



    //无源蜂鸣器 ph_buzzer
    Blockly.Blocks.microbit_passive_buzzer = {
        init:function(){
        this.setColour(color_do);
        this.appendDummyInput("")
        .appendField(new Blockly.FieldImage(staticImg+"/7.Passlve  Buzzer Module.svg", 84, 42))
        .appendField(Blockly.Msg.MICROBIT_PASSIVEBUZZER)
        .appendField(new Blockly.FieldDropdown([
            ['P0', "pin0"],
        ]),"passiveBuzzer")
        .appendField(Blockly.Msg.MICROBIT_PLAYMELODY)
        .appendField(new Blockly.FieldDropdown([
            ['DADADADUM', "music.DADADADUM"],
            ['ENTERTAINER', "music.ENTERTAINER"],
            ['PRELUDE', "music.PRELUDE"],
            ['ODE', "music.ODE"],
            ['NYAN', "music.NYAN"],
            ['RINGTONE', "music.RINGTONE"],
            ['FUNK', "music.FUNK"],
            ['BLUES', "music.BLUES"],
            ['BIRTHDAY', "music.BIRTHDAY"],
            ['WEDDING', "music.WEDDING"],
            ['FUNERAL', "music.FUNERAL"],
            ['PUNCHLINE', "music.PUNCHLINE"],
            ['BADDY', "music.BADDY"],
            ['CHASE', "music.CHASE"],
            ['BA_DING', "music.BA_DING"],
            ['JUMP_UP', "music.JUMP_UP"],
            ['JUMP_DOWN', "music.JUMP_DOWN"],
            ['POWER_UP', "music.POWER_UP"],
            ['POWER_DOWN', "music.POWER_DOWN"],
        ]), "song")
        this.setPreviousStatement(true,null);
        this.setNextStatement(true,null);
        this.setTooltip('');
        }
    };

    return Blockly;
}

module.exports = SensorbitUnoBlocks;

